<include file="./Application/Home/View/Public/header.html" title="是什么店？You will get a big surprise!!!" keywords="surprise"/>
<div id="main">
    <div style="width:500px; height:360px; padding:10px; /*border:1px solid #ccc;*/ background-color:#eee;margin-left: auto;margin-right: auto;">
        <!--        <div style="width:970px; height:8px; line-height: 8px;padding:20px; border:1px solid #ccc; background-color:#eee;float:left;margin-left: 8px;margin-bottom: 2px;clear: both;">
                    填写订单信息
                </div>-->
        <div style="width:316px; height:300px; padding:20px; /*border:1px solid #ccc;*/ background-color:#eee;margin-right: auto;margin-left: auto;clear: none;">
            <p>管理员登陆</p>
            <table class="dataintable">
                <tr>
                    <th>用户名</th>
                    <td><input type="text" id="admin_name"/></td>
                </tr>
                <tr>
                    <th>密码</th>
                    <td><input type="password" id="admin_password"/></td>
                </tr>
                <tr>
                    <th>验证码</th>
                    <td><input type="text" id="verify_code"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td>                        
                        <img id="verify_img" src="{:U('Home/Public/verify',array())}"  width="130" height="40"  title="点击刷新"/>
                    </td>
                </tr>

            </table>
            <div style="margin-top: 20px">
                <p><button class="button blue" id="submit-pic">登陆</button></p>
            </div>
        </div>
    </div>

</div>
<include file="./Application/Home/View/Public/footer.html"/>

<script type="text/javascript">
    $(function() {
        $(":input").focus(function() {
            $(this).css({background: "#C2EBFF", border: "1px solid #600", });
        }).blur(function() {
            $(this).css({background: "#CCC", border: "1px solid #000"});
        });

        $("#verify_img").click(function() {
            if ($("#verify_img").attr("src").indexOf('?') > 0) {
                $(this).attr("src", $("#verify_img").attr("src") + '&random=' + Math.random());
            } else {
                $(this).attr("src", $("#verify_img").attr("src").replace(/\?.*$/, '') + '?' + Math.random());
            }
            //http://blog.csdn.net/yafei450225664/article/details/40424025
        });

        $("#submit-pic").click(function() {
            window.location.href = '__ROOT__/index.php/Home/Admin/index/';
            var args = {"admin_name": $("#admin_name").val(), "admin_password":$("#admin_password").val(), "verify_code":$("#verify_code").val()};
            $.ajax({
                type: "POST",
                url: '__ROOT__/index.php/Home/Admin/login_action',
                dataType: "json",
                data: args,
                success: function(msg) {
                    //alert(msg.info);
                    window.location.href = '__ROOT__/index.php/Home/Admin/index/';
                }
            });
            
        });

    });
</script>
